﻿<div style="width:620px; height:260px; padding:10px;">

<link type="text/css" href="~js/lib/colorpicker/css/colorpicker.css" rel="stylesheet" />
<script>
    _run(function () {

        if ($('#menuUrl').val() == 'default') $('#chkSetDefault').click();

        $('#chkSetDefault').click(function () {
            var txtUrl = $('#menuUrl');
            txtUrl.val() == 'default' ? txtUrl.val('') : txtUrl.val('default');
        });

        require(['lib/colorpicker/js/colorpicker'], function () {


            function setColorPicker() {
                $('#colorSelector').ColorPicker({
                    color: '#0000ff',
                    onShow: function (colpkr) {
                        $(colpkr).fadeIn(200);
                        return false;
                    },
                    onHide: function (colpkr) {
                        $(colpkr).fadeOut(200);
                        //postBgColor();
                        return false;
                    },
                    onChange: function (hsb, hex, rgb) {
                        var bg = '#' + hex;
                        //setBgColor( bg );
                        $('#menuColor').val(bg);
                    }
                });
            };

            setColorPicker();

        });

    });
//-->
</script>

<form method="post" action="#{ActionLink}" class="ajaxPostForm2">

<table cellspacing="0" cellpadding="4" style="width: 100%;">
        
        
		<tr>
			<td style="width:80px;">_{name}</td>
			<td><input type="text" name="Name" value="#{m.Name}" style="width:150px;" /><span class="red">*</span>			
			<span class="left20"><label for="chkBold" style="vertical-align:middle;">粗体</label> 
			<input type="checkbox" name="chkBold" id="chkBold" style="vertical-align:middle;" #{chkBold} /></span>
			
			<span class="left20" style="vertical-align:middle;">颜色
			<input name="menuColor" id="menuColor" type="text" style="width:80px;" value="#{menuColor}" />
			<img src="~js/lib/colorpicker/images/select2.png" id="colorSelector" />  
			</span>
			
			</td>
		</tr>
        
		<tr>
			<td>_{linkPage}</td>
			<td><input type="text" name="RawUrl" value="#{m.UrlFull}" style="width:450px;" /><span class="red">*</span> <br />
			<input name="chkBlank" id="chkBlank" type="checkbox" #{chkBlank} class="left10"> <label for="chkBlank">_{openLinkInNewWindown}</label>
			</td>
		</tr>
		<tr><td colspan="2" style="height:2px;"></td></tr>

 		<tr>
			<td style="vertical-align:top;">_{friendlyUrl}</td>
			<td>
			<input id="menuUrl" type="text" name="Url" value="#{m.Url}" style="width:148px;" /> 
			<input name="chkSetDefault" id="chkSetDefault" type="checkbox" class=""> <label for="chkSetDefault">_{setMenuAsHome}</label></td>
		</tr>

		<tr>
			<td></td>
			<td>
				<input type="submit" value="_{editMenu}" class="btn"  />
				<input type="button" value="_{cancel}" class="btnCancel" />
			</td>
		</tr>
        
	</table>
</form>

</div>
